package com.tang.objectOriented.senior.codeblock_;

public class CodeBlockExercise01 {
    //编写一个main方法
    public static void main(String[] args) {
        new Test();
        Test.main(args);
    }
}
class Person {
    public static int total;//静态变量
    static {//静态代码块
        total = 100;
        System.out.println("Person in static block!");//(1)
    }
}

class Test {
    static {
        //new Test()
        System.out.println("new Test() in static block!");
    }
    public static void main(String[] args) {
        System.out.println("total = "+ Person.total); //100
        System.out.println("total = "+ Person.total); //100
    }
}